import {localeProps} from '../../utils';

const label = '按钮';
const name = 'a-button';

export default {
  icon: 'icon-button',
  label,
  name,
  mask: false,
  rule({t}) {
    return {
      type: name,
      props: {},
      children: [t('components.a-button.name')],
    };
  },
  props(_, {t}) {
    return localeProps(t, name + '.props', [
      {
        type: 'input',
        field: 'formCreateChild',
        title: '内容',
      },
      {
        type: 'select',
        field: 'size',
        title: '尺寸',
        options: [
          {
            label: 'mini',
            value: 'mini'
          },
          {
            label: 'small',
            value: 'small'
          },
          {
            label: 'medium',
            value: 'medium'
          },
          {
            label: 'large',
            value: 'large'
          }
        ]
      },
      {
        type: 'select',
        field: 'type',
        title: '类型',
        options: [
          {
            label: 'primary',
            value: 'primary'
          },
          {
            label: 'secondary',
            value: 'secondary'
          },
          {
            label: 'dashed',
            value: 'dashed'
          },
          {
            label: 'outline',
            value: 'outline'
          },
          {
            label: 'text',
            value: 'text'
          }
        ]
      },
      {
        type: 'select',
        field: 'status',
        title: '状态',
        options: [
          {
            label: 'normal',
            value: 'normal'
          },
          {
            label: 'warning',
            value: 'warning'
          },
          {
            label: 'success',
            value: 'success'
          },
          {
            label: 'danger',
            value: 'danger'
          }
        ]
      },
      {
        type: 'select',
        field: 'shape',
        title: '形状',
        options: [
          {
            label: '长方形',
            value: 'square'
          },
          {
            label: '圆形',
            value: 'circle'
          },
          {
            label: ' 全圆角',
            value: 'round'
          }
        ]
      },
      {
        type: 'switch',
        field: 'loading',
        title: '是否加载中状态'
      },
      {
        type: 'switch',
        field: 'disabled',
        title: '是否禁用状态'
      }
    ]);
  }
};
